class Arr {
    public static void main(String[] args) {
        int[] arr = { 1, 2, 3, 4, 5 };
        int sum = 0;
        for (int i = 0; i < arr.length; i++) {
            sum += arr[i];
        }

        System.out.println("Sum of array elements: " + sum);

        double[] nums = new double[] { 1.5, 2.5, 3.5, 4.5 };
        String[] colors = new String[4];
        colors[0] = "Red";
        colors[1] = "Green";
        colors[2] = "Blue";
        colors[3] = "Yellow";

        // print array
        for (int i = 0; i < nums.length; i++) {
            System.out.println(nums[i]);
        }

        // print array
        for (int i = 0; i < colors.length; i++) {
            System.out.println(colors[i]);
        }

        for (String color : colors) {
            System.out.println(color);
        }
    }
}